package Dao;

import java.util.ResourceBundle;

public class DaoFactory {

    private static ResourceBundle bundle;

    static {
        bundle = ResourceBundle.getBundle("instance");
    }


    public static <T> T getInstance(String key) {
        T userDao = null;
        try {
            userDao = (T) Class.forName(bundle.getString(key)).newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return userDao;
    }

}
